<?php
// +----------------------------------------------------------------------
// | xiongrui [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.xiongrui.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.xiongrui.cn>
// +----------------------------------------------------------------------

namespace app\common\model;


class Coupon extends Base{


  protected $insert = ['status' => -1];


  public function couponlist(){
    return $this->hasMany('CouponList');
  }

  public $addfield = array(
		array('name'=>'name','title'=>'优惠券名称','type'=>'text','help'=>''),
		array('name'=>'total_price','title'=>'满足金额','type'=>'text','help'=>''),
		array('name'=>'reduce_prcie','title'=>'优惠金额','type'=>'text','help'=>''),
		array('name'=>'sort','title'=>'排序','type'=>'num','help'=>''),
		array('name'=>'status','title'=>'状态','type'=>'select','option'=>array('1'=>'启用','0'=>'禁用'),'help'=>''),
	);

  public $addcode = array(
		array('name'=>'num','title'=>'数量','type'=>'num','help'=>''),
		array('name'=>'deadline','title'=>'到期时间','type'=>'datetime','help'=>''),
		array('name'=>'coupon_id','title'=>'优惠父id','type'=>'hidden','help'=>'')
	);


}
